package com.gao.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Projectname springboot-09-test
 * @Filename AsyncService
 * @Author an
 * @Data 2022/8/16 10:00
 * @Description TODO
 */
@Service
public class AsyncService {

    @Async //告诉spring这是一个异步方法
    public void hello(){
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("数据处理中......");
    }
}
